/*
 * thread.c
 *
 *  Created on: 2012-8-25
 *      Author: dell
 */

#include "../../include/mcf.h"
#include "assert.h"
u32 MCF_API
begin_thread(thread_t *thread)
{
    u32 ret = 0;
    assert(thread!=NULL);
#ifdef WIN32
    ret=_beginthreadex(NULL,0,thread->func,thread->params,0,&thread->addr);
//    mcf_error("thread num %d",ret);
#elif linux
    ret=pthread_create(&thread->pid,NULL,thread->func,thread->params);
    ret=ret==0?-1:errno;
#endif

    return ret;
}
u32 MCF_API
end_thread(thread_t *thread)
{
    u32 ret = 0;

    return ret;
}
